package com.example.wechat.model;

import java.time.LocalDateTime;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import com.example.project.annotation.Excel;
import com.example.project.core.domain.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * 聊天会话对象 t_wechat_conversation
 * 
 * @author ruoyi
 * @date 2025-11-12
 */
public class WechatConversation extends BaseEntity {

	private static final long serialVersionUID = 1L;

	/** 会话ID */
	private Long id;

	/** 用户ID */
	@Excel(name = "用户ID")
	private String userId;

	/** 目标ID（用户ID或群聊ID） */
	@Excel(name = "目标ID", readConverterExp = "用=户ID或群聊ID")
	private String targetId;

	/** 会话类型（1：私聊，2：群聊） */
	@Excel(name = "会话类型", readConverterExp = "1=：私聊，2：群聊")
	private Integer sessionType;

	/** 最后一条消息ID */
	@Excel(name = "最后一条消息ID")
	private Long lastMessageId;

	/** 最后一条消息内容 */
	@Excel(name = "最后一条消息内容")
	private String lastMessageContent;

	/** 最后一条消息时间 */
	@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
	@Excel(name = "最后一条消息时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
	private LocalDateTime lastMessageTime;

	/** 未读消息数 */
	@Excel(name = "未读消息数")
	private Integer unreadCount;

	/** 是否置顶（0：否，1：是） */
	@Excel(name = "是否置顶", readConverterExp = "0=：否，1：是")
	private Integer isPinned;

	/** 是否免打扰（0：否，1：是） */
	@Excel(name = "是否免打扰", readConverterExp = "0=：否，1：是")
	private Integer isMuted;

	/** 删除标志（0：正常，1：删除） */
	private Long delFlag;

	public void setId(Long id) {
		this.id = id;
	}

	public Long getId() {
		return id;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getUserId() {
		return userId;
	}

	public void setTargetId(String targetId) {
		this.targetId = targetId;
	}

	public String getTargetId() {
		return targetId;
	}

	public void setSessionType(Integer sessionType) {
		this.sessionType = sessionType;
	}

	public Integer getSessionType() {
		return sessionType;
	}

	public void setLastMessageId(Long lastMessageId) {
		this.lastMessageId = lastMessageId;
	}

	public Long getLastMessageId() {
		return lastMessageId;
	}

	public void setLastMessageContent(String lastMessageContent) {
		this.lastMessageContent = lastMessageContent;
	}

	public String getLastMessageContent() {
		return lastMessageContent;
	}

	public void setLastMessageTime(LocalDateTime lastMessageTime) {
		this.lastMessageTime = lastMessageTime;
	}

	public LocalDateTime getLastMessageTime() {
		return lastMessageTime;
	}

	public void setUnreadCount(Integer unreadCount) {
		this.unreadCount = unreadCount;
	}

	public Integer getUnreadCount() {
		return unreadCount;
	}

	public void setIsPinned(Integer isPinned) {
		this.isPinned = isPinned;
	}

	public Integer getIsPinned() {
		return isPinned;
	}

	public void setIsMuted(Integer isMuted) {
		this.isMuted = isMuted;
	}

	public Integer getIsMuted() {
		return isMuted;
	}

	public void setDelFlag(Long delFlag) {
		this.delFlag = delFlag;
	}

	public Long getDelFlag() {
		return delFlag;
	}

	@Override
	public String toString() {
		return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("id", getId())
				.append("userId", getUserId()).append("targetId", getTargetId()).append("sessionType", getSessionType())
				.append("lastMessageId", getLastMessageId()).append("lastMessageContent", getLastMessageContent())
				.append("lastMessageTime", getLastMessageTime()).append("unreadCount", getUnreadCount())
				.append("isPinned", getIsPinned()).append("isMuted", getIsMuted()).append("createTime", getCreateTime())
				.append("updateTime", getUpdateTime()).append("delFlag", getDelFlag()).toString();
	}
}
